package com.mycompany.client;

import java.io.IOException;
import java.net.UnknownHostException;

/**
 *
 * @author artyukhov
 */
public class ConnectedClientFactory {

    public ConnectedClient create(String host, String port, String name) {
        int portNum = Integer.parseInt(port);
        try {
            return new ConnectedClient(host, portNum, name);
        } catch (UnknownHostException ex) {
            throw new IllegalArgumentException("Unknown host", ex);
        } catch (IOException ex) {
            throw new IllegalArgumentException("IO Exception", ex);
        }
    }
}
